package com.itheima.day06;


import java.util.*;
import java.util.stream.Collectors;

public class Demo6 {
    public static void main(String[] args) {
        Random random = new Random();
        Set<Integer> set = new HashSet<>();
        while (set.size() < 6) {
            int i = random.nextInt(33) + 1;
            set.add(i);
        }
        System.out.println("set = " + set);

        List<Integer> list1 = set.stream()
                .sorted()
                .collect(Collectors.toList());
        System.out.println("list1 = " + list1);

        List<Integer> list = new ArrayList<>();
        for (Integer integer : set) {
            list.add(integer);
        }
        Collections.sort(list);
        System.out.println("list = " + list);
    }
}
